# Contributor: Ted Trask <ttrask01@yahoo.com>
# Maintainer: Ted Trask <ttrask01@yahoo.com>
_luaversion=5.2
pkgname=acf-provisioning
pkgver=0.10.1
pkgrel=1
pkgdesc="ACF for provisioning templated configs to devices"
url="https://git.alpinelinux.org/cgit/acf/acf-provisioning"
arch="noarch"
license="GPL-2.0"
depends="acf-core lua-sql-postgres postgresql-client lua-posixtz lua-luaxml"
makedepends=""
install=""
subpackages=""
source="https://dev.alpinelinux.org/archive/$pkgname/$pkgname-$pkgver.tar.xz"

package() {
	cd "$srcdir"/$pkgname-$pkgver

	# fix shebang
	sed -i -e "1s:#!/usr/bin/haserl :#!/usr/bin/haserl-lua$_luaversion :" \
		cgi-bin/provisioning.cgi || return 1

	make DESTDIR="$pkgdir" install
}

sha512sums="3e5678cb94ce8cd6ccd011aa1941173dd4b77811928299f2db3415dac4aab4a428ffc4dfcfcc462383ade2bc859c755683e147ccae01ef44a7b39249b7e0aaca  acf-provisioning-0.10.1.tar.xz"
